package com.dnndo.system.mapper;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dnndo.system.domain.Menu;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 菜单Mapper接口
 *
 * @author dnndo
 * @date 2025-04-23
 */
public interface MenuMapper extends BaseMapper<Menu>
{
    /**
     * 删除菜单
     *
     * @param id 菜单主键
     * @return 结果
     */
    @DS("public")
    public int deleteMenuById(Long id);

    /**
     * 根据角色ids获取菜单集合
     */
    @DS("public")
    public List<Menu> selectMenuByRoleIds(@Param("roleIds") List<Long> roleIds);
    /**
     * 根据角色id获取菜单集合
     */
    @DS("public")
    public List<Menu> selectMenuByRoleId(@Param("roleId") Long roleId);
}
